package com.googlecode.jtoy.patterns.proxy.jdk;

import com.googlecode.jtoy.patterns.proxy.Advice;
import com.googlecode.jtoy.patterns.proxy.AdviceImpl;
import com.googlecode.jtoy.patterns.proxy.Foo;
import com.googlecode.jtoy.patterns.proxy.FooImpl;

/**
 * @author shangxj
 * @date Jun 18, 2011 11:56:35 PM
 */
public class TestJdkProxy {

	public static void main(String[] args) {

		Advice advice = new AdviceImpl();

		JdkProxyFactory factory = new JdkProxyFactory(advice);

		Foo foo = (Foo) factory.newProxyInstance(new FooImpl());

		foo.bar("hello");

		System.out.println();

		foo.bar(null);

	}
}
